package com.tensquare.recruit.controller;

import com.tensquare.recruit.pojo.Enterprise;
import com.tensquare.recruit.service.EnterpriseService;
import entity.Result;
import entity.StatusCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Macross
 * @Type EnterpriseContrller.java
 * @Desc
 * @date 2019/12/17 15:39
 */
@RestController
@RequestMapping("/enterprise")
@Api(description = "企业信息管理控制器")
public class EnterpriseContrller {

    @Autowired
    private EnterpriseService enterpriseService;

    /**
     * 获取热门企业信息列表
     * @return 返回请求结果对象,其中包括热门企业列表
     */
    @GetMapping("/search/hotlist")
    @ApiOperation(value = "获取热门企业信息列表")
    public Result<List<Enterprise>> getEnterpriseHotList(){
        //获取热门企业列表
        List<Enterprise> enterpriseList = enterpriseService.getHotList();
        //将结果封装并返回
        return new Result<>(true, StatusCode.OK, "成功", enterpriseList);
    }


}
